// src/config.js
const isMicroFrontend = window.__POWERED_BY_QIANKUN__;
const isDevelopment = process.env.NODE_ENV === 'development';
// console.log('isMicroFrontend', isMicroFrontend);/
const POST = process.env.VUE_APP_PORT || 8080;
// console.log(POST, 'process.env.VUE_APP_PORT');
// 基本配置
const config = {
	// 开发环境
	development: {
		localBaseURL: '',
		cesiumBaseUrl: '',
        jsonName: 'config'
	},
	// 生产环境
	production: {
        localBaseURL: '',
		cesiumBaseUrl: '/child/app1',
        jsonName: 'config'
	},
	// 微服务环境 开发环境
    microFrontendDevelopment: {
        localBaseURL: '',
        cesiumBaseUrl: `http://localhost:${POST}`,
        setBaseUrl: `http://localhost:${POST}/Cesium/`,
        jsonName: 'config'
    },
    // 微服务环境 生产环境
    microFrontendProduction: {
        cesiumBaseUrl: '/child/app1/Cesium',
        jsonName: 'config'
    },
};

// 环境检测，可以根据实际情况调整
function determineEnvironment() {
    if (isMicroFrontend) {
        return isDevelopment ? 'microFrontendDevelopment' : 'microFrontendProduction';
    } else {
        return isDevelopment ? 'development' : 'production';
    }
}

const env = determineEnvironment();
// console.log(env, 'env');
export default config[env];
